package io.gitee.yxsnake.tenant.datasource.context;

import java.util.Objects;

/**
 * @author: snake
 * @create-time: 2024-10-10
 * @description:
 * @version: 1.0
 */
public class TenantIgnoreContextHolder {

    private final static ThreadLocal<String> CONTEXT = new ThreadLocal<>();

    private TenantIgnoreContextHolder() {
    }

    public static void set() {
        CONTEXT.set("ignore");
    }

    public static boolean get() {
        return Objects.isNull(CONTEXT.get())?Boolean.FALSE:Boolean.TRUE;
    }

    public static void remove() {
        CONTEXT.remove();
    }
}
